﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/SystemManage/Action/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });

    function initControl() {
        $("#actionowner").bindSelect({
            url: "/SystemManage/Action/GetTreeSelectJson",
        });
    }


    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/SystemManage/Action/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").resetSelection();
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>
<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">基本信息</a></li>
            @*<li ><a href="#">扩展信息</a></li>*@
        </ul>
         <div class="alert alert-danger" style="text-align: left; margin-bottom: 10px;">
                    <i class="fa fa-warning alert-dismissible" style="position: relative; top: 1px; font-size: 15px; padding-right: 5px;"></i>
                    动作编号必须唯一且为2的n次方！
         </div>
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                 <tr>
                    <th class="formTitle">动作名称<span style="color:red;">*</span></th>
                    <td class="formValue">
                        <input id="actionname" name="actionname" type="text" class="form-control required" />
                    </td>
                    <th class="formTitle">动作类型<span style="color:red;">*</span></th>
                    <td class="formValue">
                        <select id="actiontype" name="actiontype" class="form-control required">
                             <option value="0" title="1">控制器动作</option>
                            <option value="2" title="1">指定工作流使用</option>
                            <option value="4" title="1">任意工作流通用</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">控制器名称<span style="color:red;">*</span></th>
                    <td class="formValue">
                         <input id="controlername" name="controlername" type="text" class="form-control required " /> 
                    </td>
                     <th class="formTitle">动作描述<span style="color:red;">*</span></th>
                    <td class="formValue">
                        <input id="actiondescription" name="actiondescription" type="text" class="form-control required" />
                    </td>
                   
                </tr>
                <tr>
                    <th class="formTitle">动作编码</th>
                    <td class="formValue">
                        <input id="actioncode" name="actioncode" type="text" class="form-control " />
                    </td>
                </tr>
               
            </table>
        </div>
    </div>
</form>

